package de.tabuma.pm.design;

import de.tabuma.lib.contentmanagement.FacadeInterface;
import de.tabuma.pm.logik.*;
import java.util.List;
import java.util.logging.Logger;

/**
 * @author $Author$
 * @version $Revision$
 * @since $Date$
 */
public class DesignFacade implements FacadeInterface {

    private static final Logger log = Logger.getLogger(DesignFacade.class.getName());
    public static int create(Design design, String user) {
        return (int) PMF.doCreate(design, user);
    }

    public int createElement(Object object, String user) {
        log.warning(object+"/"+user);
        return create((Design) object, user);
    }

    public static Design get(int id) {
        return PMF.get(id, new Design());
    }
    public Object getElement(int id) {
        return get(id);
    }
    
    public static List<Design> getList(int projectId) {
        String keys[] = {"projectId"};
        String values[] = {""+projectId};
        return PMF.get(keys, values, new Design());
    }
    public List getElementList(String listParameter) {
        int projectId = Integer.valueOf(listParameter).intValue();
        return getList(projectId);
    }

    public static void remove(int id, String user) {
        Design design = get(id);
        PMF.doRemove(design, user);
    }
    public void removeElement(int id, String user) {
        remove(id, user);
    }

    public static void update(Design design, String user) {
        PMF.doUpdate(design, user);
    }
    public void updateElement(Object object, String user) {
        update((Design)object, user);
    }
}
